package com.lxl.openfeign.controller;

import com.lxl.openfeign.client.Sever1FeignClient;
import lombok.AllArgsConstructor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import utils.Result;

/**
 * @Author: luoxianliang
 * @Email: 1322342586@qq.com
 * @CreateTime: 2025-08-19
 * @Description: 远程调用
 * @Version: 1.0
 * @OtherInfo:
 */
@RestController
@AllArgsConstructor
public class FeignController {

    private final Sever1FeignClient.Server1FeignClient server1FeignClient;

    @GetMapping("/hello")
    public String getInstance() {
        return server1FeignClient.hello(); // 调用远程 /hello 接口
    }

    @GetMapping("/user/getUser")
    public Result getUser() {
        return server1FeignClient.getUser();
    }
}
